<!DOCTYPE html>
<html>
<head>
	<title>Multicolumn combo</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
	<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
	<link rel="stylesheet" type="text/css" href="../../../codebase/fonts/font_roboto/roboto.css"/>
	<link rel="stylesheet" type="text/css" href="../../../codebase/dhtmlxcombo.css"/>
	<script src="../../../codebase/dhtmlxcombo.js"></script>
	<style>
		h4.info_text {
			font-family: Arial;
			font-size: 14px;
		}
		td.descr_td {
			 padding-right: 50px;
			 vertical-align: top;
		}
	</style>
	<script>
		var myCombo;
		var myCombo2;
		var myCombo3;
		
		function doOnLoad() {
			
			// from script
			myCombo = new dhtmlXCombo("combo_zone_script", "combo_script", 200);
			myCombo.setTemplate({
				input: "#capital#, #country#",
				columns: [
					{header: "&nbsp;",  width:  40, css: "flag",    option: "<img src='#flag#' border='0' style='margin-top: 4px; margin-left: 2px;'>"},
					{header: "Capital", width:  80, css: "capital", option: "#capital#"},
					{header: "Country", width: 110, css: "country", option: "#country#"},
					{header: "Proverb", width: 250, css: "proverb", option: "#proverb#"}
				]
			});
			myCombo.addOption([
				{value: "1", text: { flag: "../common/flags/austria.png", country: "Austria", capital: "Vienna", proverb: "Two wrongs don't make a right" } },
				{value: "2", text: { flag: "../common/flags/belarus.png", country: "Belarus", capital: "Minsk", proverb: "The pen is mightier than the sword" } },
				{value: "3", text: { flag: "../common/flags/cameroon.png", country: "Cameroon", capital: "Yaoundé", proverb: "Actions speak louder than words" }, selected: 1 },
				{value: "4", text: { flag: "../common/flags/canada.png", country: "Canada", capital: "Ottawa", proverb: "If it ain't broke, don't fix it" } }
			]);
			myCombo.enableFilteringMode(true);
			
			// fron json
			myCombo2 = new dhtmlXCombo("combo_zone_json", "combo_json", 200);
			myCombo2.load("../common/multicolumn_data.json");
			myCombo2.enableFilteringMode(true);
			
			// from xml
			myCombo3 = new dhtmlXCombo("combo_zone_xml", "combo_xml", 200);
			myCombo3.load("../common/multicolumn_data.xml");
			myCombo3.enableFilteringMode(true);
			
		}
	</script>
</head>
<body onload="doOnLoad();">
	<h3>Multicolumn combo demo</h3>
	<div style='font-size: 10px; color: #555; font-family: Arial;'><b>*</b> Any resemblance to reality is purely coincidental</div>
	<br>
	<h4 class="info_text">Init from script</h3>
	<div id="combo_zone_script"></div>
	<br>
	<h4 class="info_text">JSON from server</h3>
	<div id="combo_zone_json"></div>
	<br>
	<h4 class="info_text">XML from server</h3>
	<div id="combo_zone_xml"></div>
</body>
</html>
